from rest_framework import serializers
from goods_info.models import AttachmentModel


class AttachmentSerializers(serializers.ModelSerializer):
    '''
    附件的序列化器和反序列化
    '''
    type_display = serializers.CharField(source='get_a_type_display', read_only=True)

    class Meta:
        model = AttachmentModel
        fields = '__all__'
